<!DOCTYPE html>
<html lang='zh-CN'>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
<style>

</style>
</head>
<body>

<script>
         // 斐波那契数列 黄金比例数字
        // 1 1 2 3 5 8....
        // 传入第几项，返回这一项
        // 传入1 拿到1
        // 传入2 拿到1
        // 传入3 拿到2...
        // fn(1) = 1 
        // fn(2) = 1 
        // fn(3) = fn(1) + fn(2)
        // fn(4) = fn(2) + fn(3)
        function fn(n) {
            if ([1, 2].includes(n)) return 1
            return fn(n - 2) + fn(n - 1)
        }
        const result = fn(8)
        console.log(result)
</script>
</body>
</html>